package com.smart.mip.system.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;


/**
 * create by scaffold 2017-07-18 
 * @author codefan@sina.com
 
  角色操作权限null   
*/
@Entity
@Table(name = "F_ROLE_POWER")
public class RolePower implements java.io.Serializable {
	private static final long serialVersionUID =  1L;



	/**
	 * 角色操作代码 null 
	 */
	@Id
	@Column(name = "rp_code")
	@GeneratedValue(generator = "assignedGenerator")
	@GenericGenerator(name = "assignedGenerator", strategy = "uuid")
	private String rpCode;

	/**
	 * 角色代码 null 
	 */
	@Column(name = "role_code")
	@Length(max = 32, message = "字段长度不能大于{max}")
	private String  roleCode;
	/**
	 * 操作代码 null 
	 */
	@Column(name = "OPT_CODE")
	@Length(max = 32, message = "字段长度不能大于{max}")
	private String  optCode;
	/**
	 * 创建时间 null 
	 */
	@Column(name = "CreateDate")
	private Date  createdate;


	// Constructors
	/** default constructor */
	public RolePower() {
		super();
	}
	/** minimal constructor */
	public RolePower(
		String rpCode		
		) {
	
	
		this.rpCode = rpCode;		
			
	}

/** full constructor */
	public RolePower(
	 String rpCode		
	,String  roleCode,String  optCode,Date  createdate) {
	
	
		this.rpCode = rpCode;		
	
		this.roleCode= roleCode;
		this.optCode= optCode;
		this.createdate= createdate;		
	}
	

  
	public String getRpCode() {
		return this.rpCode;
	}

	public void setRpCode(String rpCode) {
		this.rpCode = rpCode;
	}
	// Property accessors
  
	public String getRoleCode() {
		return this.roleCode;
	}
	
	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}
  
	public String getOptCode() {
		return this.optCode;
	}
	
	public void setOptCode(String optCode) {
		this.optCode = optCode;
	}
  
	public Date getCreatedate() {
		return this.createdate;
	}
	
	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}

	
public RolePower copy(RolePower other){
  
		this.setRpCode(other.getRpCode());
  
		this.roleCode= other.getRoleCode();  
		this.optCode= other.getOptCode();  
		this.createdate= other.getCreatedate();

		return this;
	}
	
	public RolePower copyNotNullProperty(RolePower other){
  
	if( other.getRpCode() != null){
	this.setRpCode(other.getRpCode());}
  
		if( other.getRoleCode() != null)
			this.roleCode= other.getRoleCode();  
		if( other.getOptCode() != null)
			this.optCode= other.getOptCode();  
		if( other.getCreatedate() != null)
			this.createdate= other.getCreatedate();		

		return this;
	}

	public RolePower clearProperties(){
  
		this.roleCode= null;  
		this.optCode= null;  
		this.createdate= null;

		return this;
	}
}
